package cn.knight.feignclient;

import cn.knight.domain.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;


@FeignClient(value = "user-server", fallbackFactory = UserFeignClientFallbackFactory.class)
public interface UserFeignClient {

    // 配置feign负载均衡的接口
    // 五同，服务名相同，请求方式、请求路径相同，返回值相同，形参相同
    @GetMapping("/user/{id}")
    User getById(@PathVariable Long id);
}
